#pragma once

namespace hawking {
namespace indexlib {

template <typename Key, typename Value>
struct KeyValueItem {
    Key key;
    Value value;
    bool friend operator<(const KeyValueItem& left, const KeyValueItem& right)
    {
        return left.key != right.key ? left.key < right.key : left.value < right.value;
    }
    bool friend operator<(const Key& key, const KeyValueItem& right) { return key < right.key; }
    bool friend operator<(const KeyValueItem& left, const Key& key) { return left.key < key; }
    bool friend operator==(const KeyValueItem& left, const KeyValueItem& right)
    {
        return left.key == right.key && left.value == right.value;
    }
} __attribute__((packed));

}
}
